﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// 
    /// </summary>
    public class MultiplyInverseMultiplyIterations : MacroFilter
    {
        protected int m_nIterations = 10;

        /// <summary>
        /// Initializes a new instance of the <see cref="MultiplyInverseMultiplyIterations"/> class.
        /// </summary>
        public MultiplyInverseMultiplyIterations()
        {
            this.FilterList.Add(new UmgekehrtMultiplizieren());
            this.FilterList.Add(new Multiplizieren());
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MultiplyInverseMultiplyIterations"/> class.
        /// </summary>
        /// <param name="_nIterations">The _n iterations.</param>
        public MultiplyInverseMultiplyIterations(int _nIterations)
        {
            m_nIterations = _nIterations;
        }

        /// <summary>
        /// Now this can also be used to specify the iterations for the execution of each filter
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            for (int i = 0; i < m_nIterations;i++ )
            {
                base.Execute(_bitmap);
            }
            return _bitmap;
        }
    }
}
